#ifndef IMODULE_H
# define IMODULE_H

#include <string>
#include <map>
#include <vector>
#include "IRequest.h"
#include "IResponse.h"
#include "ITask.h"

#define POMMEDAPIVERSION (1.0)

namespace PommedAPI
{
  class IModule
  {
  public:
    virtual ~IModule() {}

    enum State
    {
      DECLINE,
      FATALERROR,
      FINISHED
    };

    enum Step
    {
      INIT,
      DECRYPT,
      DECODE,
      HANDLER,
      ENCODE,
      CRYPT,
      DESTROY
    };

    virtual float		getModuleAPIVersion() { return (POMMEDAPIVERSION); }
    virtual const std::string&	getModuleName() = 0;
    virtual const std::string&	getModuleDescription() = 0;

    virtual State		runStep(Step, ITask&, IIBuffer&, IOBuffer&) = 0;
  };
}

extern "C"
{
  PommedAPI::IModule*		getInstance(std::map<std::string, std::string>&, std::vector<PommedAPI::IModule::Step>&);
}

#endif // IMODULE_H
